package com.wang.springbootinit.common;

/**
 * 自定义错误码
 */
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    TOO_MANY_REQUEST(42900, "请求过于频繁"),

    NOT_FOUND_ERROR(40400, "请求数据不存在"),

    FORBIDDEN_ERROR(40300, "禁止访问"),

    SYSTEM_ERROR(50000, "系统内部异常"),

    OPERATION_ERROR(50001, "操作失败"),
    NOINTEGRAL(40099,"积分不足"),
    NO_INVOKE_COUNT(40088,"调用次数不足"),
    THE_MAILBOX_HAS_BEEN_USED(50101,"邮箱已被使用"),
    EMAIL_NOT_REGISTERED(50102,"邮箱未注册"),
    VERIFICATION_CODE_ERROR(50103,"验证码错误"),
    PASSWORD_IS_INVALID(50104,"密码不合法"),
    BLACKLIST_USER(50201,"黑名单用户，无法登录"),
    WRONG_PASSWORD(40102,"密码错误"),
    ACCOUNT_DOES_NOT_EXIST(40103,"账号不存在"),
    STUDENT_CODE_NOT_EXIST(40104,"学号不存在"),
    STUDENT_NOT_EXIST(40105,"学生不存在")
            ;

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
